<?php
require './config.php';
header("Content-Type:image/png");
$color=array(221,221,221);
$str=array('A','B','C','D','E','F','G','H','I','J','K','L','M','N','P','Q','R','S','T','U','V','W','X','Y','Z','1','2','3','4','5','6','7','8');
$c=count($str);
$randstr='';
for($i=0;$i<4;$i++){
	$randstr.=$str[rand(0,($c-1))];
}
$_SESSION[IMAGESESSIONNAME]=strtolower($randstr);
$img=imagecreate(100,40);
imagecolorallocate($img,17,17,17);
$red=imagecolorallocate($img,$color[0],$color[1],$color[2]);
//$font=APPDATA.XG.'arial.ttf';
$font=ADMINDATA . DIRECTORY_SEPARATOR . 'actionj.ttf';
for($i=0;$i<4;$i++){
	imagettftext($img,26,rand(-5,5),(6+(rand(20,22)*$i)),35,$red,$font,$randstr{$i});
}
imagepng($img);
imagedestroy($img);
